from fnmatch import fnmatch, fnmatchcase

print(fnmatch('foot.txt', '*txt'))
print(fnmatch('foot.txt', '?oot.txt'))
print(fnmatch('Dat1.csv', 'Dat[0-9]*'))
# 在windows系统中底层操作系统对大小写不敏感程度/os Mac对大小写敏感
print(fnmatch('foo.txt', '*.TXT'))

names = ['Dat1.csv','Dat2.csv','config.ini','foo.py']
my_list = [name for name in names if fnmatch(name,"Dat*.csv")]
print(my_list)

